The present invention relates to a method and electronic circuit thereof, and more particularly, to a method capable of detecting an addressing mode of a storage device and electronic system thereof.
Generally, an electronic system, such as a system-on-chip (SOC) system, needs an external storage device for booting operation. As technology advances, the capacity of the storage device becomes larger. An addressing mode of the storage device therefore needs to contain more bytes for addressing data stored in the storage device. For example, if the external storage device is a serial peripheral interface (SPI) flash memory and the capacity of which is less than 16 MB, the storage device may uses a 3-byte addressing mode for addressing data. Instead, if the storage device is an SPI flash memory and the capacity of which is more than 16 MB, the storage device may use a 4-byte addressing mode for addressing data. With storage devices using different addressing modes, the electronic system therefore needs an additional bootstrap bin for indicating an addressing mode of the storage device, which complicates the trace of the electronic system.
Specifically, please refer to FIG. 1, which is a schematic diagram of a conventional electronic system 10. The electronic system 10 comprises a processing module 100, a storage device 102 and an accessing module 104. In detail, code segments that are going to be executed by the processor module 100 are stored in the storage device 102. The storage device 102 may be an SPI flash memory. When the electronic system 10 starts a booting operation, the processing module 100 issues commands including an address to the accessing module 104. The accessing module 104 then transmits the commands to the storage device 102 according to an addressing mode instructed by a bootstrap bin BS via a related bus, for fetching a specific code segment stored in the storage device 102. After interpretation, the specific code segment is usually a specific instruction used by the processing module 100. The processing module 100 uses the specific instruction to execute various actions or data processing.
As can be seen, if the addressing mode of the storage device 102 can be automatically detected instead of being indicated by the bootstrap bin BS, the bootstrap bin BS can be removed, such that the trace of the electronic system 10 can be simplified and the manufacture cost of the electronic system 10 can be reduced.